<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="adminTemplate.xhtml">

    <ui:define name="contentAdmin">
        <h1>Create New User</h1>
        <h:messages showDetail="true"/>
        <h:form>
        <table>
            <tr>
                <td><h:outputLabel for="loginname" value="User Login: " /></td>
                <td><h:inputText id="loginname" value="#{userCreate.userToCreate.login}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="password" value="Password: "/></td>
                <td><p:password id="password" value="#{userCreate.userToCreate.password}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="firstname" value="First name: "/></td>
                <td><h:inputText id="firstname" value="#{userCreate.userToCreate.firstName}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="lastname" value="Last Name: "/></td>
                <td><h:inputText id="lastname" value="#{userCreate.userToCreate.lastName}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="group" value="Group: "/></td>
                <td>
                    <h:selectOneMenu id="group" value="#{userCreate.selectedGroup}">
                       <f:selectItems value="#{userCreate.availableGroups}" />
                    </h:selectOneMenu>
                </td>
            </tr>
            <tr>
                <td><h:outputLabel for="enabled" value="Enabled: "/></td>
                <td><h:selectBooleanCheckbox id="enabled" value="#{userCreate.userToCreate.enabled}"/></td>
            </tr>
            <tr>
                <td><h:outputLabel for="description" value="Description(optional): "/></td>
                <td>
                    <h:inputTextarea id="description" value="#{userCreate.userToCreate.description}"/>
                </td>
            </tr>
        </table>
        <p:growl id="message" showDetail="true"/>
        <p:commandButton value="Create User" actionListener="#{userCreate.createUser}" update="message"/>
        </h:form>
    </ui:define>

</ui:composition>